// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: "2025-07-15",
  devtools: { enabled: true },
  alias: {
    '@': '.',
  },
  modules: ["@nuxt/eslint", "@nuxtjs/tailwindcss", "nuxt-nodemailer", [
    "@pinia/nuxt",
    {
      autoImports: [
        // 自动引入 `defineStore()`
        "defineStore",
        // 自动引入 `defineStore()` 并重命名为 `definePiniaStore()`
        ["defineStore", "definePiniaStore"],
      ],
    },
  ], "@ant-design-vue/nuxt", [
    "@pinia-plugin-persistedstate/nuxt",
    {
      cookieOptions: {
        maxAge: 2 * 365 * 24 * 60 * 60 * 1000,
      },
      storage: "localStorage",
    },
  ], "nuxt-echarts"],
  runtimeConfig: {
    db: {
      host: process.env.DB_HOST || "localhost",
      port: process.env.DB_PORT || "3306",
      user: process.env.DB_USER || "root",
      password: process.env.DB_PASSWORD || "",
      name: process.env.DB_NAME || "nuxt_db",
    },
    mail: {
      host: process.env.MAIL_HOST || "smtp.gmail.com",
      port: process.env.MAIL_PORT || "587",
      secure: process.env.MAIL_SECURE === "true",
      auth: {
        user: process.env.MAIL_USER || "",
        pass: process.env.MAIL_PASS || "",
      },
    },
    public: {
      appName: process.env.APP_NAME || "Nuxt App",
      appUrl: process.env.APP_URL || "http://localhost:3000",
    },
  },
});